﻿using IM.Easy.Core.Security;
using IM.Easy.Core.SeedData;
using IM.Easy.Entity.System;
using IM.Easy.Infrastructure;
using SqlSugar;

namespace IM.Easy.Api.SeedData
{
    public class SysUserSeed : MemorySeedData<SysUser>, ISqlSugarSeed<SysUser>
    {

        public override List<SysUser> Read()
        {
            var hashPassword = Sha256Hash.ComputeHash("123456");

            var users = new List<SysUser>
            {
                  new () {
                     Id = 1,
                     UserName = "admin",
                     Password = hashPassword,
                     NickName = "超级管理员",
                     RealName = "蜗易管理员",
                     Mobile = "18088888888",
                     Email = "admin@163.com",
                     Gender = 0,
                     BirthDay = DateTime.Parse("2024-09-19 09:03:39"),
                     Avatar = "http://8.141.83.119:5000/static/avatar/fa2c1228-9c81-4dee-9c97-22859dcfb303.jpg",
                     DeptId = 1, IsActive = true,  LastLoginTime = null,
                     CreationSource =CreationConstant.System,
                     Remark =  "系统初始化",
                     IsSystem = true,
                     LocalEmail=true,
                 },
                  new () {
                     Id = 2,
                     UserName = "user",
                     Password = hashPassword,
                     NickName = "普通用户",
                     RealName = "张三",
                     Mobile = "18088886666",
                     Email = "user@163.com",
                     Gender = 0,
                     BirthDay = DateTime.Now,
                     Avatar = "http://8.141.83.119:5000/static/avatar/fa2c1228-9c81-4dee-9c97-22859dcfb303.jpg",
                     DeptId = 1, IsActive = true,  LastLoginTime = null,
                     CreationSource =CreationConstant.System,
                     Remark = "系统初始化",
                     IsSystem = true,
                     LocalEmail=true,
                 },
            };
            return users;
        }

    }
}
